package com.usian.service.impl;

import com.usian.mapper.AdSsqMapper;
import com.usian.pojo.AdSsq;
import com.usian.result.Result;
import com.usian.service.AdSsqService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import tk.mybatis.mapper.entity.Example;

import java.util.List;

@Service
@SuppressWarnings("ALL")
public class AdSsqServiceImpl implements AdSsqService {

    @Autowired
    private AdSsqMapper adSsqMapper;

    @Override
    public Result findByParentId(Integer id) {
        if(id == null){
            throw new RuntimeException("失败");
        }
        Example example = new Example(AdSsq.class);
        example.createCriteria().andEqualTo("pid",id);
        List<AdSsq> list =  adSsqMapper.selectByExample(example);
        return new Result(list);
    }
}
